package com.wkhyapp.lm.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.wkhyapp.lm.R;
import com.wkhyapp.lm.adapter.base.HolderEntity;
import com.wkhyapp.lm.adapter.base.MirAdapter;
import com.wkhyapp.lm.http.vo.Goods;
import com.wkhyapp.lm.utils.ImageLoadUtil;

import java.util.List;

/**
 * Created by fang on 2021/10/14.
 */

public class GoodsImageAdapter extends MirAdapter<String> {

    public GoodsImageAdapter.callBack mCallBack;

    public GoodsImageAdapter(Context context, List<String> mDatas, int itemLayoutId) {
        super(context, mDatas, itemLayoutId);
    }

    @Override
    public void convert(HolderEntity helper, final String item) {

        ImageView img_iv = helper.getView(R.id.img_iv);
        ImageLoadUtil.setRoundImage_Normal(mContext,item,0,img_iv);
        img_iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mCallBack.view(item);
            }
        });
    }

    public void  setCallBack(GoodsImageAdapter.callBack callBack){
        this.mCallBack = callBack;
    }


    public interface  callBack{
        void view(String item);
    }

}
